﻿using System;
using Autodesk.Revit.DB;
using YArchitech.Revit;

namespace HYRElectric.MaterialStatistics
{
	public class XmlAttributeData
	{
		public string Title { get; set; }

		public string Name { get; set; }

		public string StrBuiltInParameter { get; set; }

		public Parameter GetParameter(Element ele)
		{
			Parameter result;
			if (this.StrBuiltInParameter.CompareTo("") == 0)
			{
				result = ele.GetParameter(this.Name);
			}
			else
			{
				BuiltInParameter builtInParameter = (BuiltInParameter)Enum.Parse(typeof(BuiltInParameter), this.StrBuiltInParameter, true);
				result = ele.get_Parameter(builtInParameter);
			}
			return result;
		}
	}
}
